import configService from 'services/config'

export default {
    display_header: ({dispatch}, header) => dispatch('DISPLAY_HEADER', header),
    fetch_shop_type: ({dispatch}) => {
        return configService
            .fetchShopType()
            .then(({data}) => data, () => ({type: 'integral', ratio: 500, name: 'dftg'}))
            .then(data => {
                dispatch('CHANGE_TYPE', data);
                dispatch('CHANGE_TITLE', data.name);
                return data;
            })
    }
}
